package com.entity;

import java.util.Date;

import org.springframework.format.annotation.DateTimeFormat;

public class Question {
	private Integer qid;
	private String qtitle;
	private String optiona;
	private String optionb;
	private String optionc;
	private String optiond;
	private Integer stageid;
	private Integer qtype;
	private String keyword;
	private String answer;
	private String analysis;
	private Date createtime = new Date();
	private Integer status=0;
	@DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
	private Date begintime;
	@DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
	private Date endtime;
	private String[] keys;
	
	
	public Question() {
	}
	public Question(Integer qtype) {
		this.qtype = qtype;
	}
	public Date getBegintime() {
		return begintime;
	}
	public void setBegintime(Date begintime) {
		this.begintime = begintime;
	}
	public Date getEndtime() {
		return endtime;
	}
	public void setEndtime(Date endtime) {
		this.endtime = endtime;
	}
	public String[] getKeys() {
		if(keyword!=null&& !"".equals(keyword.trim()))
			return keyword.split(",");
		return null;
	}
	public void setKeys(String[] keys) {
		this.keys = keys;
	}
	public String getKeyword() {
		return keyword;
	}
	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
	
	public Integer getQid() {
		return qid;
	}
	public void setQid(Integer qid) {
		this.qid = qid;
	}
	public String getQtitle() {
		return qtitle;
	}
	public void setQtitle(String qtitle) {
		this.qtitle = qtitle;
	}
	public String getOptiona() {
		return optiona;
	}
	public void setOptiona(String optiona) {
		this.optiona = optiona;
	}
	public String getOptionb() {
		return optionb;
	}
	public void setOptionb(String optionb) {
		this.optionb = optionb;
	}
	public String getOptionc() {
		return optionc;
	}
	public void setOptionc(String optionc) {
		this.optionc = optionc;
	}
	public String getOptiond() {
		return optiond;
	}
	public void setOptiond(String optiond) {
		this.optiond = optiond;
	}
	public Integer getStageid() {
		return stageid;
	}
	public void setStageid(Integer stageid) {
		this.stageid = stageid;
	}
	public Integer getQtype() {
		return qtype;
	}
	public void setQtype(Integer qtype) {
		this.qtype = qtype;
	}
	public String getAnswer() {
		return answer;
	}
	public void setAnswer(String answer) {
		this.answer = answer;
	}
	public String getAnalysis() {
		return analysis;
	}
	public void setAnalysis(String analysis) {
		this.analysis = analysis;
	}
	public Date getCreatetime() {
		return createtime;
	}
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	@Override
	public String toString() {
		return "Question [qid=" + qid + ", qtitle=" + qtitle + ", optiona="
				+ optiona + ", optionb=" + optionb + ", optionc=" + optionc
				+ ", optiond=" + optiond + ", stageid=" + stageid + ", qtype="
				+ qtype + ", keyword=" + keyword + ", answer=" + answer
				+ ", analysis=" + analysis + ", createtime=" + createtime + "]";
	}
	
	
}
